package com.xty.commodity.foodFactory.iteamFactories;

import com.xty.commodity.Item;
import com.xty.commodity.foodFactory.FoodFactory;
import com.xty.commodity.impl.instance.food.ChickenBurger;
import com.xty.commodity.impl.instance.food.VegBurger;
import com.xty.constant.DefaultValue;
import lombok.extern.slf4j.Slf4j;

/**
 * Created By IntelliJ IDEA
 *
 * @author 许腾洋
 * @date 2021/11/25
 * description:
 */
@Slf4j
public class BurgerFactory implements FoodFactory {
    /**
     * 返回订单商品（食物名称、包装、价格）
     *
     * @return Item
     */
    @Override
    public Item getItem(String name) {
        if (DefaultValue.CHICKEN_BURGER.equals(name)){
            return new ChickenBurger();
        }
        if (DefaultValue.VEG_BURGER.equals(name)){
            return new VegBurger();
        }
        log.info("BurgerFactory:暂时没有该商品[{}]或者已售空",name);
        return null;
    }
}
